﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ERPStudio;

namespace ERPForms
{
    public partial class SeriiNumericeRezumatFrm : FrmRezumat
    {
        public SeriiNumericeRezumatFrm(ModuleClass mInfo)
            : base(mInfo)
        {
            InitializeComponent();
            workConnString = "ESRPConnectionString";
        }

        private void SeriiNumericeRezumatFrm_Load(object sender, EventArgs e)
        {
            
            this.listBndSourceMain.Add(seriiNumericeBindingSource);
            this.listTableAdaptor.Add(this.seriiNumericeTableAdapter.Adapter);

            if (!EsteArhiva())
            {
                AddButton("Salvare", global::ERPStudio.Properties.Resources.salvare1, Salvare, ToolStripItemAlignment.Right, true);
                HandleSalvare += new EventHandler(Salvare);
            }
            eSRPDataSet.SeriiNumerice.CodUnitateColumn.DefaultValue = ModuleInfo.CodUnitate;
            SetCurentUnit(ModuleInfo.CodUnitate);
        }
        override public void SetCurentUnit(short vCodUnitate)
        {
            this.seriiNumericeTableAdapter.Connection = DeschideConexiune(workConnString);
            this.seriiNumericeTableAdapter.Fill(this.eSRPDataSet.SeriiNumerice, vCodUnitate);
            InchideConexiune(this.seriiNumericeTableAdapter.Connection);
        }
        override public void SetCurentMonth(short vCodUnitate)
        {
            //Setup(conn);
        }
        /// <summary>
        /// cand se apasa enter, controlul activ este luna, anul
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        override public void toolStripLabelAnLuna_Click(object sender, EventArgs e)
        {

        }

    }
}
